package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.nursing.service.ReservationService;
import com.zzyl.nursing.vo.CountByTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/member/reservation/cancelled-count")
public class ReservationController {
    @Autowired
    private ReservationService reservationService;
    @GetMapping("/cancelled-count")
    public AjaxResult selectCancelledCount(){
        Integer count = reservationService.selectCancelledCount();
        return AjaxResult.success(count);
    }
    @GetMapping("/countByTime")
    public AjaxResult selectCancelledCountByTime(Long time){
        List<CountByTime> list = reservationService.selectCancelledCountByTime(time);
        return AjaxResult.success(list);
    }
}
